#ifndef ANIM_H
#define ANIM_H

#include "widget.h"

#include <QWidget>
#include <QDesktopWidget>
#include <QTimer>
#include <QTime>
#include <QGraphicsEffect>
#include <QDebug>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QBrush>
#include <QParallelAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QPropertyAnimation>
#include <QShowEvent>



namespace Ui {
    class Anim;
}

class Anim : public CenteredWidget
{
    Q_OBJECT

public:
    explicit Anim (CenteredWidget *parent = 0);
    ~Anim ();

protected:
    void changeEvent (QEvent * event);
    void showEvent (QShowEvent *event);
    void hideEvent (QHideEvent *event);

private slots:
    void onTimerTimeout ();
    void onRejected ();

signals:
    void stopProcess ();

private:
    Ui::Anim *ui;
    QTimer* m_timer;
    QString m_pub;
    QGraphicsView* m_view;
    QGraphicsScene* m_scene;
    QGraphicsTextItem* m_item;
    QGraphicsPixmapItem* m_pixmapItem;
    int m_duration;
    int m_currentChar;

    bool m_isSimpleAnimation;
};

#endif // ANIM_H
